import request from '@/utils/request'
import qs from 'qs'

export function rentMessage(equtype, iDisplayStart, iDisplayLength, state) {
  const data = {
    equtype,
    iDisplayStart,
    iDisplayLength,
    state
  }
  return request({
    url: `/admin/equ/lease/find`,
    method: 'post',
    data: qs.stringify(data)
  })
}
export function rentAudit(state, id) {
  const data = {
    state,
    id
  }
  return request({
    url: `/admin/equ/lease/opt`,
    method: 'get',
    params: {
      ...data
    }
  })
}
export function rentDetail(id) {
  const data = {
    id
  }
  return request({
    url: `/admin/equ/lease/findById`,
    method: 'get',
    params: {
      ...data
    }
  })
}
export function sellMessage(enttype, page, size, state) {
  const data = {
    enttype,
    page,
    size,
    state
  }
  return request({
    url: `/admin/equ/sale/find`,
    method: 'post',
    data: qs.stringify(data)
  })
}
export function sellAudit(state, id) {
  const data = {
    state,
    id
  }
  return request({
    url: `/admin/equ/sale/opt`,
    method: 'post',
    data: qs.stringify(data)
  })
}
export function sellDetail(id) {
  const data = {
    id
  }
  return request({
    url: `/admin/equ/sale/findById`,
    method: 'get',
    params: {
      ...data
    }
  })
}
export function maintainMessage(maintainScope, page, size, state) {
  const data = {
    maintainScope,
    page,
    size,
    state
  }
  return request({
    url: `/admin/equ/maintain/find`,
    method: 'post',
    data: qs.stringify(data)
  })
}
export function maintainAudit(state, id) {
  const data = {
    state,
    id
  }
  return request({
    url: `/admin/equ/maintain/opt`,
    method: 'post',
    data: qs.stringify(data)
  })
}
export function maintainDetail(id) {
  const data = {
    id
  }
  return request({
    url: `/admin/equ/maintain/findById`,
    method: 'get',
    params: {
      ...data
    }
  })
}
